package com.qzsoft.zhjd.server.modules.ludong.weigh.service.impl;

import com.qzsoft.zhjd.server.modules.ludong.weigh.entity.WeighBridgeEntity;
import com.qzsoft.zhjd.server.modules.ludong.weigh.mapper.WeighBridgeMapper;
import com.qzsoft.zhjd.server.modules.ludong.weigh.service.WeighBridgeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service("weighBridgeService")
public class WeighBridgeServiceImpl extends ServiceImpl<WeighBridgeMapper, WeighBridgeEntity> implements WeighBridgeService {


    /**
     * 功能描述: 先删除后添加
     * @param entity 实体类
     * @return : void
     * @author : liugf
     * @date : 2020/6/10 20:25
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void insertAndRemoveData(WeighBridgeEntity entity) {
        //todo:项目暂时写死,标段写死,拌合楼写死
        String itemId = "13081b400ee2139875e07224715430ee";
        entity.setOrganizationId(itemId);
        String mixingStationCode = "1c3ac359b3857e97188fac5ecda1ae76";
        entity.setMixingStationCode(mixingStationCode);
        entity.setSectionId("111");
        removeById(entity.getId());
        save(entity);
    }

}
